<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #main {
        width: 800px;
        height: 500px;
      }
    </style>
  </head>
  <body>
    <div id="main"></div>
    <script src="./echarts.min.js"></script>
    <script>
      const myChart = echarts.init(document.getElementById('main'))
      const option = {
        title: {
          text: '焦梦园',
          subtext: '第十二组',
          top: '3%',
          left: '50%',
        },

        xAxis: [
          {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sta', 'Sun'],
            axisLine: {
              lineStyle: {
                type: 'dashed',
              },
            },
          },
        ],
        yAxis: [
          {
            type: 'value',
            splitLine: {
              lineStyle: {
                type: 'dashed',
              },
            },
          },
        ],
        color: [
          {
            type: 'linear',
            x: 0,
            y: 0,
            x2: 0,
            y2: 1,
            colorStops: [
              {
                offset: 0,
                color: 'pink', // 0% 处的颜色
              },
              {
                offset: 1,
                color: 'skyblue', // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
          // 径向渐变，前三个参数分别是圆心 x, y 和半径，取值同线性渐变
          {
            type: 'radial',
            x: 0.5,
            y: 0.5,
            r: 0.5,
            colorStops: [
              {
                offset: 0,
                color: 'yellow', // 0% 处的颜色
              },
              {
                offset: 1,
                color: 'red', // 100% 处的颜色
              },
            ],
            global: false, // 缺省为 false
          },
        ],
        series: [
          {
            name: 'Desert',
            type: 'bar',

            emphasis: {
              focus: 'series',
            },
            data: [150, 232, 201, 154, 190, 200, 180],
          },
          {
            name: 'Wetland',
            type: 'bar',

            emphasis: {
              focus: 'series',
            },
            data: [180, 260, 190, 160, 160, 220, 240],
          },
        ],
      }
      myChart.setOption(option)
    </script>
  </body>
</html>
